package com.cheesmo.nzb.util;

import java.io.FileNotFoundException;
import java.io.IOException;

import org.xml.sax.SAXException;

import com.cheesmo.nzb.model.NZB;
import com.cheesmo.nzb.model.impl.NzbParser;

public class NzbUtils
{
	public static NZB parseFile(String pathToFile)
	{
		NzbParser parser = new NzbParser();
		try {
			return parser.parse(pathToFile);
		} catch (FileNotFoundException e) {
			System.err.println("Could not parse " + pathToFile + ":  " + e.getMessage());
		} catch (SAXException e) {
			System.err.println("Could not parse " + pathToFile + ":  " + e.getMessage());
		} catch (IOException e) {
			System.err.println("Could not parse " + pathToFile + ":  " + e.getMessage());
		}
		return null;
	}
}
